package ch.ethz.fcl.metrobuzz;

import ch.ethz.fcl.metrobuzz.controller.MBController;
import ch.ethz.fcl.metrobuzz.data.MBData;
import ch.ethz.fcl.metrobuzz.render.MBRenderer;
import ch.ethz.fcl.metrobuzz.viewer.MBViewer;
import ch.ethz.fcl.metrofont.MetroFont;

public class MBContainer {
	private MBViewer view;
	private MBController control;
	private MBRenderer render;
	private MBData data;
	private MetroFont fm;

	public void setView(MBViewer view) {
		this.view = view;
	}

	public void setController(MBController control) {
		this.control = control;
	}

	public void setRender(MBRenderer render) {
		this.render = render;
	}

	public void setData(MBData data) {
		this.data = data;
	}

	public void createFont() {
		fm = new MetroFont();
	}

	public MBViewer getViewer() {
		return view;
	}

	public MBController getControl() {
		return control;
	}

	public MBRenderer getRender() {
		return render;
	}

	public MBData getData() {
		return data;
	}

	public MetroFont getFont() {
		if (fm == null)
			createFont();
		return fm;
	}

	public void reset() {
		if (view != null)
			view.reset();
		if (render != null)
			render.reset();
		if (control != null)
			control.reset();
	}
}
